﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class jobseeker_JobSeekerMasterPage : System.Web.UI.MasterPage
{
    #region Variables
    protected string strPageHeader = String.Empty;
    protected string sBaseUrl = ConfigurationManager.AppSettings["WC_baseurl"];
    #endregion

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //if (!Context.User.Identity.IsAuthenticated)
            //Response.Redirect("../login.aspx");
            if (Session["SESS_JobSeekerName"] == null)
            {
                Response.Redirect("../login.aspx");
            }
            else
            {
                LoadPageHeaders();
            }

        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('ERROR :" + ex.Message.ToString() + "');</script>");
        }

    }
    private void LoadPageHeaders()
    {
        string strHeaderId = String.Empty;
        string strCssClass = "current";

        strHeaderId = Request.QueryString["Header"];
        strPageHeader += " <ul>";
        if (strHeaderId != null && strHeaderId == "JobseekerHome")
        {
            strPageHeader += "<li><a href='Default.aspx?Header=JobseekerHome' class='" + strCssClass + "'>Home</a></li>";

        }
        else
        {
            strPageHeader += "<li><a href='Default.aspx?Header=JobseekerHome'>Home</a></li>";

        }
        if (strHeaderId != null && strHeaderId == "JobseekerAccount")
        {
            strPageHeader += "<li><a href='myaccounts.aspx?Header=JobseekerAccount' class='" + strCssClass + "'>My Accounts</a></li>";

        }
        else
        {
            strPageHeader += "<li><a href='myaccounts.aspx?Header=JobseekerAccount'>My Accounts</a></li>";

        }
        if (strHeaderId != null && strHeaderId == "JobseekerJobs")
        {
            strPageHeader += "<li><a href='jobsearch.aspx?Header=JobseekerJobs' class='" + strCssClass + "'>Search Jobs</a></li>";

        }
        else
        {
            strPageHeader += "<li><a href='jobsearch.aspx?Header=JobseekerJobs'>Search Jobs</a></li>";

        }
        if (strHeaderId != null && strHeaderId == "JobseekerProfile")
        {
            strPageHeader += "<li><a href='editprofile.aspx?Header=JobseekerProfile' class='" + strCssClass + "'>Edit Profile</a></li>";

        }
        else
        {
            strPageHeader += "<li><a href='editprofile.aspx?Header=JobseekerProfile'>Edit Profile</a></li>";

        }
        if (strHeaderId != null && strHeaderId == "JobseekerLogout")
        {
            strPageHeader += "<li><a href='signout.aspx?Header=JobseekerLogout' class='" + strCssClass + "'>Sign Out</a></li>";

        }
        else
        {
            strPageHeader += "<li><a href='signout.aspx?Header=JobseekerLogout'>Sign Out</a></li>";

        }
        strPageHeader += " </ul>";

    }
}
